/*
 * @Author:   LiuNing - liuning_apple@126.com
 * @Date:     2020年11月14日15:18:12
 */
import instance from '@/utils/axios'
const base = 'oa/'

// 获取部门列表
export const getDepartment = () => {
  return instance({
    url: 'get-department',
    method: 'post'
  })
}
// 获取流程列表(所有流程列表)
export const getOaList = () => {
  return instance({
    url: `${base}approve`,
    method: 'post'
  })
}

// 获取oa消息通知
export const getOaNotice = (data) => {
  return instance({
    url: `${base}workflow/get-notice`,
    method: 'post',
    data
  })
}
// OA-保存申请（绩效）流程-自定义字段通用版
export const save = (data) => {
  return instance({
    url: `${base}workflow/save`,
    method: 'post',
    data
  })
}

// 审批操作
export const check = (data) => {
  return instance({
    url: `${base}workflow/check`,
    method: 'post',
    data
  })
}

// oa 特殊事项申请单
export const getOaSpecialEvent = (data) => {
  return instance({
    url: `${base}specilitem-apply`,
    method: 'post',
    data
  })
}
// oa 特殊事项申请单
export const getInfoSave = (data) => {
  return instance({
    url: `${base}workflow/save`,
    method: 'post',
    data
  })
}

// oa 特殊价格申请单
export const getOaSpecialPrice = (data) => {
  return instance({
    url: `${base}specilprice-apply`,
    method: 'post',
    data
  })
}

// 获取自定义字段
export const getAutoKey = (id) => {
  return instance({
    url: `${base}workflow/get-node-fields`,
    method: 'post',
    params: {
      approve_node_id: id
    }
  })
}

// 获取初始化时需要的字段
export const getStartKey = (id, token) => {
  return instance({
    url: `${base}workflow/add`,
    method: 'get',
    params: {
      approve_id: id,
      // token: token
      openid: token
    }
  })
}
// 印章列表
export const sealList = (data) => {
  return instance({
    url: `${base}seal`,
    method: 'post',
    data
  })
}
// OA-内部人员
export const getStaff = (data) => {
  return instance({
    url: `${base}get-staff`,
    method: 'post',
    data
  })
}
// OA-新申请下一个操作人
export const nextUser = (data) => {
  return instance({
    url: `${base}workflow/next-user`,
    method: 'post',
    data
  })
}
// OA-待处理申请列表
export const getWaitList = (data) => {
  return instance({
    url: `${base}workflow/get-wait-list`,
    method: 'post',
    data
  })
}
// OA-我申请的列表
export const getMyList = (data) => {
  return instance({
    url: `${base}workflow/get-my-list`,
    method: 'post',
    data
  })
}
// OA-申请事务详情
export const info = (data) => {
  return instance({
    url: `http://oa.xngjgg.cn/api/${base}workflow/info`,
    method: 'post',
    data
  })
}
// OA-upload
export const upload = (data) => {
  return instance({
    url: `${base}upload`,
    method: 'post',
    data
  })
}

// OA-upload
export const uploadList = (data) => {
  return instance({
    url: `${base}workflow/files`,
    method: 'post',
    data
  })
}
// OA-下一处理步骤
export const getNextNode = (data) => {
  return instance({
    url: `${base}workflow/get-next-node`,
    method: 'post',
    data
  })
}
// OA-处理记录列表
export const process = (data) => {
  return instance({
    url: `${base}workflow/process`,
    method: 'post',
    data
  })
}
// OA-处理记录列表
export const setNext = (data) => {
  return instance({
    url: `${base}workflow/set-next`,
    method: 'post',
    data
  })
}
// OA-获取当前节点可以委派的人  qqqqq
export const getAppointer = (data) => {
  return instance({
    url: `${base}workflow/get-node-appointer`,
    method: 'post',
    data
  })
}
// OA-可退回的节点
export const getReback = (data) => {
  return instance({
    url: `${base}workflow/get-reback-node`,
    method: 'post',
    data
  })
}
// OA-保存回退的节点信息
export const setReback = (data) => {
  return instance({
    url: `${base}workflow/set-reback`,
    method: 'post',
    data
  })
}
// OA-最近20条通过审核的预约
export const passList = (data) => {
  return instance({
    url: 'booking/pass-list',
    method: 'post',
    data
  })
}
// OA-导入点位
export const Import = (data) => {
  return instance({
    url: 'booking/import',
    method: 'post',
    data
  })
}
export const getUser = (data) => {
  return instance({
    url: 'user/info',
    method: 'post',
    data
  })
}
export const getJump = (data) => {
  return instance({
    url: `${base}workflow/get-jump-node`,
    method: 'post',
    data
  })
}
export const setJump = (data) => {
  return instance({
    url: `${base}workflow/set-jump`,
    method: 'post',
    data
  })
}
export const getDoneList = (data) => {
  return instance({
    url: `${base}workflow/get-done-list`,
    method: 'post',
    data
  })
}
export const getCopy = (data) => {
  return instance({
    url: `${base}workflow/get-copy`,
    method: 'post',
    data
  })
}
// 召回
export const recheck = (data) => {
  return instance({
    url: `${base}workflow/recheck`,
    method: 'post',
    data
  })
}
// 删除文件
export const delDoc = (data) => {
  return instance({
    url: `${base}workflow/del-file`,
    method: 'post',
    data
  })
}
// v3-点位拍照信息
export const photoList = (data) => {
  return instance({
    url: '/billboard/photo-list',
    method: 'post',
    data
  })
}
// v3-行业分类
export const type = (data) => {
  return instance({
    url: 'customer/type',
    method: 'post',
    data
  })
}

// OA-okr列表
export const orkList = (data) => {
  return instance({
    url: `${base}okr-list`,
    method: 'post',
    data
  })
}
// OA-okr岗位
export const okrPosition = () => {
  return instance({
    url: `${base}okr-position`,
    method: 'get'
  })
}

// 终止
export const stopStep = (data) => {
  return instance({
    url: `${base}workflow/set-stop`,
    method: 'post',
    data
  })
}

export const getUserGroup = (data) => {
  return instance({
    url: '/get-user-group',
    method: 'post',
    data
  })
}
